/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.web.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;
import com.jeeplus.modules.web.entity.WxCouponType;

import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;

/**
 * 奖品管理Entity
 * @author rongjie
 * @version 2017-09-04
 */
public class WxGoods extends DataEntity<WxGoods> {
	
	private static final long serialVersionUID = 1L;
	private String goodsName;		// 抽奖商品
	private int goodsTotal;		// 剩余奖品
	private String goodsRate;		// 中奖概率
	private int goodsTouch;		// 触发次数
	private Date time;		// 添加时间
	private Date setTime;		// 触发时间
	private Integer type;		// 是否奖励积分
	private String integration;		// 赠送积分值
	private String name;		// 赠送积分值
	private int index;		// 赠送积分值
	private WxCouponType coupon;		// 赠送优惠券id
	
	public WxGoods() {
		super();
		this.setIdType(IDTYPE_AUTO);
	}

	public WxGoods(String id){
		super(id);
	}

	@Length(min=1, max=30, message="抽奖商品长度必须介于 1 和 30 之间")
	@ExcelField(title="抽奖商品", align=2, sort=1)
	public String getGoodsName() {
		return goodsName;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}
	
	@ExcelField(title="剩余奖品", align=2, sort=2)
	public int getGoodsTotal() {
		return goodsTotal;
	}

	public void setGoodsTotal(int goodsTotal) {
		this.goodsTotal = goodsTotal;
	}
	
	@ExcelField(title="中奖概率", align=2, sort=3)
	public String getGoodsRate() {
		return goodsRate;
	}

	public void setGoodsRate(String goodsRate) {
		this.goodsRate = goodsRate;
	}
	
	@ExcelField(title="触发次数", align=2, sort=4)
	public int getGoodsTouch() {
		return goodsTouch;
	}

	public void setGoodsTouch(int goodsTouch) {
		this.goodsTouch = goodsTouch;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="添加时间", align=2, sort=5)
	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="触发时间", align=2, sort=6)
	public Date getSetTime() {
		return setTime;
	}

	public void setSetTime(Date setTime) {
		this.setTime = setTime;
	}
	
	@NotNull(message="是否奖励积分不能为空")
	@ExcelField(title="是否奖励积分", dictType="goodsType", align=2, sort=7)
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}
	
	@ExcelField(title="赠送积分值", align=2, sort=8)
	public String getIntegration() {
		return integration;
	}

	public void setIntegration(String integration) {
		this.integration = integration;
	}
	
	@ExcelField(title="赠送优惠券id", fieldType=WxCouponType.class, value="", align=2, sort=9)
	public WxCouponType getCoupon() {
		return coupon;
	}

	public void setCoupon(WxCouponType coupon) {
		this.coupon = coupon;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}